<template>
	<view class="goods_wrap" @click="handleGoodsClick">
		<img :src="image" class="img"/>
		<view class="info">
			<view class="top">
				{{name}}
			</view>
			<view class="bottom">
				<text class="price">￥{{price}}</text>
				<text class="mins">时间：{{mins}}分钟</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"Goods",
		props:['image','name','mins','price'],
		methods:{
			handleGoodsClick(){
				uni.setStorage({
					key:'selectedTreatment',
					data:this.name,
					success() {
						uni.navigateTo({
							url:'/pages/detail/index'
						})
					}
				})
				
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style lang="less" scoped>
	.goods_wrap{
		width: 330rpx;
		height: 300rpx;
		box-shadow: 3rpx 3rpx 6rpx #d3d1d1 ; 
		background-color: #fff;
		margin-bottom: 15rpx;
		padding: 10rpx;
		display: flex;
		justify-content: center;
		flex-direction: column;

		.img{
			width: 100%;
			height: 70%;
		}

		.info{
			height: 30%;
			width: 100%;
			background-color: #fbf9f9;

			.top{
				color: #6A3E3E;
				font-size: 24rpx;
				width:90%;
				margin: 10rpx auto;
			}

			.bottom{
				margin:0 auto;
				margin-top: -5rpx;
				width:90%;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				align-items: center;
				
				.price{
					color:#AD5353;
					font-size: 29rpx;
					font-weight: bold;
				}

				.mins{
					color:#D1A8A8;
					font-size: 20rpx;
					height:15rpx;
					line-height: 15rpx; 
				}
			}
		}
	}

</style>